﻿<UserControl x:Class="yavc.Phone.Controls.VolumeControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:conv="clr-namespace:yavc.Phone.Lib.Util;assembly=yavc.Phone.Lib"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    <UserControl.Resources>
        <conv:InverterConverter x:Key="invCov" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <Style TargetType="Button" BasedOn="{StaticResource clearButtonStyle}">
                <Setter Property="VerticalAlignment" Value="Top" />
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}" />
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center" Grid.Column="1" Margin="0,5,0,12">
            <TextBlock Text="{Binding VolumeString}" />
            <TextBlock Text=" - " />
            <TextBlock Text="{Binding DSP}" />
        </StackPanel>
        <Slider x:Name="volSlder" Grid.Column="1"
                IsEnabled="{Binding Muted, Converter={StaticResource invCov}, Mode=OneWay}" 
                ManipulationCompleted="volSlder_ManipulationCompleted"
                VerticalAlignment="Top"
                Minimum="{Binding Minimum}" 
                Maximum="{Binding Maximum}"
                Value="{Binding Value, Mode=TwoWay}" />

        <Button Content="-" Click="VolumeDown_Click" />
        <Button Content="+" Click="VolumeUp_Click" Grid.Column="2" />
    </Grid>
</UserControl>
